home *** CD-ROM | disk | FTP | other *** search
- Path: lf.hp.com!gajdos
- From: gajdos@lf.hp.com (Larry Gajdos)
- Newsgroups: comp.lang.c++
- Subject: Re: HELP ! => Problem compiling STL classes in Visual C++ 4.1.
- Date: 15 Apr 1996 15:05:50 GMT
- Organization: Hewlett-Packard Little Falls Site
- Message-ID: <4ktoke$o99@hpavua.lf.hp.com>
- References: <4kh12t$rs0@newsbf02.news.aol.com>
- NNTP-Posting-Host: gajdos@eden.lf.hp.com
- X-Newsreader: TIN [version 1.2 PL2.2]
-
- Pete Becker's comments on namespace seem to be ringing true since I am
- continually running into problems incorporating namespaces, as suggested
- by Microsoft in their readme files accompanying the STL.
-
- However, the compiler error problem you mentioned can be solved by
- problem by including new.h (a C library header file) _before_ including
- any STL files. (I'm assuming you've made the 10 or so changes
- recommended by Microsoft--sprinkling "std::"'s in place of "::"'s.)
- By the way, I have found it useful to recognize that the line ,
- "#define std", undoes all of those edits to your STL header files. This
- is useful if you want to use one STL source stream for namespace and
- non-namespace applications.
-
- Good luck and keep the net posted on any workarounds that you discover!
-
- Larry Gajdos
- (not speaking for HP and in no way affiliated with that part of HP that
- was involved in the STL--and it shows!)
-
- #include <new.h>
- #include <iostream.h> //rumor has it that pre-including this is also useful!
-
- : namespace std
- : {
- : #include <Vector.h>
- : #include <Algo.h>
- : }
-
-
- : main ()
- : {
- : std::vector <int> v;
-
- : v[0] = 1; v [1]=2; v[2]=3;
- : }
-